<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>机机快修</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=3,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
	<link href="css/public/reset-html5.css" rel="stylesheet">
	<link href="css/public/mui.min.css" rel="stylesheet">
	<link href="css/wx-main.css?20161028_1" rel="stylesheet">
	<style>
		.mui-card{
			padding:20px;
			font-size:14px;
			display:block;
			color:#888;
			margin:0;
			border-radius:0;
			box-shadow:none;
		}
		.card-title{
			margin-bottom:15px;
		}
		.user{
			display:flex;
			align-items:top;
			border-bottom:1px solid #ddd;
		}
		.user img{
			width:80px;
			height:80px;
			border-radius:50%;
			margin-right:15px;
		}
		.username{
			font-size:18px;
		}
		.user_item{
			margin-bottom:7px;
		}
		.business{
			display:flex;
			border-bottom:1px solid #ddd;
		}
		.business > a{
			flex:1;
			padding-left:70px;
		}
		.business > a:first-child{
			border-right:1px solid #ddd;
		}
		.repair{
			background:url(image/快递.png) #fff no-repeat 12px center;
			background-size:40px 40px;
		}
		
		.recycle{
			background:url(image/回收.png) #fff no-repeat 12px center;
			background-size:40px 40px;
		}
		.account{
			display:flex;
			align-items:center;
		}
		.account img{
			width:40px;
			height:40px;
			margin-right:10px;
		}
	</style>
</head>
<body id="main">
	<a class="mui-card user">
		<img src="{{user.m_head_imgurl}}" alt="">
		<div>
			<div class="user_item username" v-text="user.m_name"></div>
			<div class="user_item">工号：<span v-text="user.m_job_num"></span></div>
			<div class="user_item">类型：<span v-text="types[user.m_type]"></span></div>
		</div>
	</a>

	<div class="business">
		<a class="mui-card repair" href="repair_order.html">
			<div class="card-title">维修订单管理</div>
			<div>
				<span>待接单:</span>
				<span v-text="repairData.order_info.wait"></span>
			</div>
		</a>
		<a class="mui-card recycle" href="recycle_order.html">
			<div class="card-title">回收订单管理</div>
			<div>
				<span>待接单:</span>
				<span v-text="data.order_count"></span>
			</div>
		</a>
	</div>
	
	<a class="mui-card account" style="" href="admin.html" v-if="!(user.m_type==6 && user.m_type==5)">
		<img src="image/money.png" alt="">
		<div>
			<div class="card-title">账户管理</div>
			<div>
				<span>余额:</span>
				<span v-text="data.money"></span>
			</div>
		</div>
	</a>
</body>
<script src="../js/jquery-2.2.1.min.js"></script>
<script src="../plugins/vue/vue.min.js"></script>
<script src="js/public.js"></script>
<script src="layer_mobile/layer.js"></script>
<script>
	var vue = new Vue({
		el:"#main",
		data:{
			data:"",
			repairData:"",
			user:{},
			types:{
				"2":"联盟商户",
				"3":"自有工程师",
				"4":"滴滴工程师",
				"5":"联盟商户工程师",
				"6":"联盟商户门店"
			}
		},
		methods:{
		
		},
		ready:function(){
			var thiz = this;
			/*获取回收订单数据*/
			var index = layer.open({type: 2,shadeClose:false});
			$.get(apiRecycle+'index.php/Home/Master/get_master_dashboard',{},function(res){
				thiz.data = res.data;
				layer.close(index);
			},'json');
			
			var index = layer.open({type: 2,shadeClose:false});
			$.get(apiRecycle+'index.php/Home/Master/access_to_master_information',{},function(res){
				thiz.user = res.data;
				layer.close(index);
			},'json');
			
			/*获取维修订单数据*/
			var index = layer.open({type: 2,shadeClose:false});
			$.get(apiRepair+'admin.php?m=Home&c=Index&a=getAdminIndex',{},function(res){
				thiz.repairData = res.data;
				layer.close(index);
			},'json');
		}
	});
</script>
</html>